<nav class="navbar navbar-expand-md navbar-light shadow-sm rounded px-5"
     th:fragment="flag" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
     xmlns:th="http://www.thymeleaf.org"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.pollix.at/thymeleaf/shiro">

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="navbar-toggler-icon"></span>
        </button>
        <a class="navbar-brand" href="#">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-shop-window"
                 viewBox="0 0 16 16">
                <path d="M2.97 1.35A1 1 0 0 1 3.73 1h8.54a1 1 0 0 1 .76.35l2.609 3.044A1.5 1.5 0 0 1 16 5.37v.255a2.375 2.375 0 0 1-4.25 1.458A2.371 2.371 0 0 1 9.875 8 2.37 2.37 0 0 1 8 7.083 2.37 2.37 0 0 1 6.125 8a2.37 2.37 0 0 1-1.875-.917A2.375 2.375 0 0 1 0 5.625V5.37a1.5 1.5 0 0 1 .361-.976l2.61-3.045zm1.78 4.275a1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0 1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0 1.375 1.375 0 1 0 2.75 0V5.37a.5.5 0 0 0-.12-.325L12.27 2H3.73L1.12 5.045A.5.5 0 0 0 1 5.37v.255a1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0zM1.5 8.5A.5.5 0 0 1 2 9v6h12V9a.5.5 0 0 1 1 0v6h.5a.5.5 0 0 1 0 1H.5a.5.5 0 0 1 0-1H1V9a.5.5 0 0 1 .5-.5zm2 .5a.5.5 0 0 1 .5.5V13h8V9.5a.5.5 0 0 1 1 0V13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9.5a.5.5 0 0 1 .5-.5z"/>
            </svg>
            商城系统
        </a>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="navbar-nav">
                <li class="nav-item">
                </li>
                <li class="nav-item">
                    <a th:class="${topbar} eq 'userCenter' ? 'nav-link active fw-bolder' : 'nav-link'"
                       href="/user-center.html">个人中心</a>
                </li>

            </ul>
            <ul class="navbar-nav ml-md-auto me-auto">
                <li class="nav-item active">
                    <a class="nav-link" th:href="@{/admin}">后台管理中心</a>
                </li>
            </ul>
            <div>
                <h5 th:if="${session.loginUser == null}">欢迎访问, 游客</h5>
                <div th:if="${session.loginUser != null}" class="">
                    <h5 id="userid" th:if="${session.loginUser != null}"
                        th:attr="data-userid=${session.loginUser.getId()}">
                    </h5>
                    <div class="dropdown">

                        <img id="topbar-head" th:src="${session.loginUser.getImg()}" class="dropdown-toggle"
                             style="height: 60px; width: 60px; border-radius: 50%" role="button"
                             data-bs-toggle="dropdown">
                        <ul class="dropdown-menu dropdown-menu-start">
                            <li><a class="dropdown-item" href="/user-center.html">个人中心</a></li>
                            <li><a class="dropdown-item" href="/admin">管理员中心</a></li>
                            <li><a class="dropdown-item" href="/user/logout">退出登陆</a></li>
                        </ul>
                        <span th:text="${session.loginUser.getRole().getName()}" class="badge bg-success">Success</span>
                    </div>

                </div>
            </div>
            <div class="col-md-1"></div>
        </div>
</nav>